package com.doubledragon.tiny.aop.pointcutAdvisor;

import org.aopalliance.aop.Advice;

/**
 * Created by dragon
 *
 * 内置AspectJ切点表达式解析器的增强器
 */
public class AspectJExpressionPointcutAdvisor implements PointcutAdvisor {
    private AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();

    // 这是一个增强器的接口， AdvisedSupport类中的methodInterceptor就是继承自它
    private Advice advice;

    //设置表达式，以启用AspectJExpressionPointcut的匹配功能
    public void setExpression(String expression) {
        this.pointcut.setExpression(expression);
    }

    public void setAdvice(Advice advice) {
        this.advice = advice;
    }



    @Override
    public Pointcut getPointcut() {
        return pointcut;
    }

    @Override
    public Advice getAdvice() {
        return advice;
    }
}
